package com.cashmama.market.api.application.controller.order.request;

import com.cashmama.market.api.infras.enums.error.OrderRestErrorEnum;
import com.cashmama.market.api.infras.exception.ApplicationException;
import com.fqgj.common.api.ParamsObject;
import com.fqgj.common.utils.StringUtils;

/**
 * Author: Karl
 * Date: 2020/10/28 下午2:17
 */
public class OrderWithdrawRequest extends ParamsObject {
    private String tradeNo;

    public String getTradeNo() {
        return tradeNo;
    }

    public OrderWithdrawRequest setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
        return this;
    }

    @Override
    public void validate() {
        if (StringUtils.isEmpty(tradeNo)) {
            throw new ApplicationException(OrderRestErrorEnum.TRADE_NO_NOT_EMPTY);
        }
    }
}
